package com.acidsweet.zerolrucache;

import android.content.Context;

import com.acidsweet.zerolrucache.core.impl.MemoryLruCache;
import com.acidsweet.zerolrucache.util.Logger;

/**
 * Created by jin on 16/10/20.
 * Util for ZeroLruCache
 * Create 3 default and single-ton Cache
 */

public class ZeroLruCache {
    //3 default LruCache in DCL single-ton
    private static final String TAG=ZeroLruCache.class.getSimpleName();
    private static MemoryLruCache mMemoryLruCache=null;
    public static MemoryLruCache getDefaultMemoryLruCache(Context context)
    {
        Logger.d(TAG,"getDefaultMemoryLruCache");
        if(mMemoryLruCache==null)
            synchronized (ZeroLruCache.class)
            {
                if(mMemoryLruCache==null)
                {
                    mMemoryLruCache=(new MemoryLruCache.Builder()).create();
                }
            }
        return mMemoryLruCache;
    }
}
